#ifndef SAMPLE_H
#define SAMPLE_H
#include <vector>
#include <map>
#include <string>

#define CPU_NUMS 32

enum class Metric
{
    L1_REF,
    L1_MISS,
    L2_REF,
    L2_MISS,
    L3_REF,
    L3_MISS,
};

struct cache_stat {
	int cpu;
	std::map<Metric, unsigned long> metrics;
};

class Collector {
public:
    Collector() = default;
    ~Collector() = default;

    void Start(int pid);

    void EnableVerbose() {
        verbose = true;
    }

    std::map<int, cache_stat> Read();
private:
    int pd = -1;
    std::map<std::string, Metric> evtMetric;
    bool verbose = false;
};

#endif
